home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / Asm / AB3DIIsrc / source_4000 / MultiPLAYERSHOOT.s < prev    next >
Encoding:
Text File  |  1996-07-28  |  25.0 KB  |  1,642 lines

  1.  
  2. PLR1_clicked: dc.b 0
  3. PLR2_clicked: dc.b 0
  4. PLR3_clicked: dc.b 0
  5. popping: ds.l 5*4
  6. targdist: dc.w 0
  7. targetydiff: dc.l 0
  8. PLR1_TimeToShoot: dc.w 0
  9. PLR2_TimeToShoot: dc.w 0
  10. PLR3_TimeToShoot: dc.w 0
  11.  
  12. tempangpos: dc.w 0
  13.  
  14. MaxFrame: dc.w 0
  15. BULTYPE: dc.w 0
  16. AmmoInMyGun: dc.w 0
  17.  
  18. Player1Shot:
  19.  
  20.  tst.w PLR1_TimeToShoot
  21.  beq.s okcanfire
  22.  
  23.  move.w TempFrames,d0
  24.  sub.w d0,PLR1_TimeToShoot
  25.  bge PLR1_nofire
  26.  move.w #0,PLR1_TimeToShoot
  27.  bra PLR1_nofire
  28.  
  29. okcanfire:
  30.  
  31.  moveq #0,d0
  32.  move.b p1_gunselected,d0
  33.  move.b d0,tempgun
  34.  
  35.  
  36.  move.l LINKFILE,a6
  37.  lea GunBulletTypes(a6),a6
  38.  lea BulletAnimData-GunBulletTypes(a6),a5
  39.  lea (a6,d0.w*8),a6
  40.  move.w G_BulletType(a6),d0 ; bullet type
  41.  move.w d0,BULTYPE
  42.  move.l #PLAYERONEAMMO,a0
  43.  move.w (a0,d0.w*2),AmmoInMyGun
  44.  
  45.  muls #B_BulStatLen,d0
  46.  add.w d0,a5
  47.  
  48.  move.w B_MovementSpeed+2(a5),BulletSpd
  49.  
  50. ; tst.w (a6)
  51. ; beq.s .itsaclick
  52.  
  53.  tst.b p1_fire
  54.  beq PLR1_nofire
  55. ; bra .itsahold
  56. ;
  57. ;.itsaclick:
  58. ; tst.b p1_clicked
  59. ; beq PLR1_nofire
  60. ;
  61. ;.itsahold:
  62.  
  63.  move.w PLR1_angpos,d0
  64.  move.w d0,tempangpos
  65.  move.l #SineTable,a0
  66.  lea (a0,d0.w),a0
  67.  move.w (a0),tempxdir 
  68.  move.w 2048(a0),tempzdir
  69.  move.w PLR1_xoff,tempxoff
  70.  move.w PLR1_zoff,tempzoff
  71.  move.l PLR1_yoff,tempyoff
  72.  add.l #10*128,tempyoff
  73.  move.b PLR1_StoodInTop,tempStoodInTop
  74.  move.l PLR1_Roompt,tempRoompt
  75.  move.l #%100011,d7
  76.  move.w #-1,d0
  77.  move.l #0,targetydiff
  78.  move.l #$7fff,d1
  79.  
  80.  move.l ZoneAdds,a3
  81.  
  82.  move.l #PLR1_ObsInLine,a1
  83.  move.l ObjectData,a0
  84.  move.l #PLR1_ObjDists,a2
  85. findclosestinline
  86.  
  87.  tst.w (a0)
  88.  blt outofline
  89.  
  90.  cmp.b #3,16(a0)
  91.  beq notlinedup
  92.  
  93.  tst.b (a1)+
  94.  beq.s notlinedup
  95.  btst #0,17(a0)
  96.  beq.s notlinedup
  97.  tst.w 12(a0)
  98.  blt.s notlinedup
  99.  move.b 16(a0),d6
  100.  btst d6,d7
  101.  beq.s notlinedup
  102.  
  103.  tst.b numlives(a0)
  104.  beq.s notlinedup
  105.  move.w (a0),d5
  106.  move.w (a2,d5.w*2),d6
  107.  move.w 4(a0),d2
  108.  ext.l d2
  109.  asl.l #7,d2
  110.  sub.l PLR1_yoff,d2
  111.  move.l d2,d3
  112.  bge.s .oknotneg
  113.  neg.l d2
  114. .oknotneg:
  115.  divs #44,d2
  116.  cmp.w d6,d2
  117.  bgt.s notlinedup
  118.  
  119.  cmp.w d6,d1
  120.  blt.s notlinedup
  121.  move.w d6,d1
  122.  move.l a0,a4
  123.  
  124. ; We have a closer enemy lined up.
  125.  move.l d3,targetydiff 
  126.  move.w d5,d0
  127.  
  128. notlinedup:
  129.  add.w #64,a0
  130.  bra findclosestinline
  131.  
  132. outofline:
  133.  
  134.  
  135.  move.w d1,targdist
  136.  
  137.  move.l targetydiff,d5
  138.  sub.l PLR1_height,d5
  139.  add.l #18*256,d5
  140.  move.w d1,closedist
  141.  
  142.  move.w BulletSpd,d2
  143.  asr.w d2,d1
  144.  tst.w d1
  145.  bgt.s okdistthing
  146.  moveq #1,d1
  147. okdistthing
  148.  divs d1,d5
  149.  move.w d5,bulyspd
  150.  
  151.  move.w AmmoInMyGun,d2
  152.  move.w G_BulletsPerShot(a6),d1
  153.  cmp.w d1,d2
  154.  bge.s .okcanshoot
  155.  
  156.  move.l PLR1_Obj,a2
  157.  move.w (a2),d0
  158.  move.l #ObjRotated,a2
  159.  move.l (a2,d0.w*8),Noisex
  160.  move.w #100,Noisevol
  161.  move.w #100,PLAYERONENOISEVOL
  162.  move.w #12,Samplenum
  163.  clr.b notifplaying
  164.  move.b #$fb,IDNUM
  165.  jsr MakeSomeNoise
  166.  
  167.  rts
  168.  
  169. .okcanshoot:
  170.  
  171.  cmp.b #'s',mors
  172.  beq.s .notplr1
  173.  move.l PLR1_Obj,a2
  174.  move.w #1,ObjTimer+128(a2)
  175. .notplr1
  176.  
  177.  move.w G_DelayBetweenShots(a6),PLR1_TimeToShoot
  178.  
  179.  move.b MaxFrame,PLR1_GunFrame
  180.  sub.w d1,d2
  181.  
  182.  move.l #PLAYERONEAMMO,a2
  183.  add.w BULTYPE,a2
  184.  add.w BULTYPE,a2
  185.  move.w d2,(a2)
  186.  
  187.  move.l PLR1_Obj,a2
  188.  move.w (a2),d2
  189.  move.l #ObjRotated,a2
  190.  move.l (a2,d2.w*8),Noisex
  191.  move.w #100,PLAYERONENOISEVOL
  192.  move.w #300,Noisevol
  193.  move.w G_SoundEffect(a6),Samplenum
  194.  move.b #2,chanpick
  195.  clr.b notifplaying
  196.  movem.l d0/a0/d5/d6/d7/a6/a4/a5,-(a7)
  197.  move.b #$fb,IDNUM
  198.  jsr MakeSomeNoise
  199.  movem.l (a7)+,d0/a0/d5/d6/d7/a6/a4/a5
  200.  
  201.  tst.w d0
  202.  blt nothingtoshoot
  203.  
  204.  tst.l B_Gravity(a5)
  205.  beq.s .notuseaim
  206.  move.w PLR1_AIMSPD,d2
  207.  move.w #8,d1
  208.  sub.w BulletSpd,d1
  209.  asr.w d1,d2
  210.  move.w d2,bulyspd
  211. .notuseaim
  212.  
  213.  tst.w B_VisibleOrInstant+2(a5)
  214.  beq PLR1FIREBULLET
  215.  
  216. ; instant effect: check for hitting:
  217.  
  218.  move.w G_BulletsPerShot(a6),d7
  219.  
  220. FIREBULLETS:
  221.  
  222.  movem.l a0/a1/d7/d0/a4/a5,-(a7)
  223.  jsr GetRand
  224.  
  225.  move.l ObjectPoints,a1
  226.  move.w (a4),d1
  227.  lea (a1,d1.w*8),a1
  228.  
  229.  and.w #$7fff,d0
  230.  move.w (a1),d1
  231.  sub.w PLR1_xoff,d1
  232.  muls d1,d1
  233.  move.w 4(a1),d2
  234.  sub.w PLR1_zoff,d2
  235.  muls d2,d2
  236.  add.l d2,d1
  237.  asr.l #6,d1
  238.  ext.l d0
  239.  asl.l #1,d0
  240.  cmp.l d1,d0
  241.  bgt.s .hitplr
  242.  
  243.  movem.l (a7)+,a0/a1/d7/d0/a5/a4
  244.  move.l d0,-(a7)
  245.  bsr PLR1MISSINSTANT
  246.  move.l (a7)+,d0
  247.  
  248.  bra.s .missplr
  249. .hitplr: 
  250.  
  251.  movem.l (a7)+,a0/a1/d7/d0/a5/a4
  252.  move.l d0,-(a7)
  253.  bsr PLR1HITINSTANT
  254.  move.l (a7)+,d0
  255.  
  256. .missplr:
  257.  
  258.  subq #1,d7
  259.  bgt.s FIREBULLETS
  260.  
  261.  rts
  262.  
  263. PLR1_AIMSPD: dc.l 0
  264. PLR3_AIMSPD: dc.l 0
  265.  
  266. PLR1_PAUSE: dc.w 0
  267. PLR2_PAUSE: dc.w 0
  268. PLR3_PAUSE: dc.w 0
  269. PLR3_Squished: dc.w 0
  270.  
  271. PLR1QUITTING: dc.w 0
  272. PLR2QUITTING: dc.w 0
  273. PLR3QUITTING: dc.w 0
  274.  
  275. nothingtoshoot:
  276.  move.w PLR1_AIMSPD,d0
  277.  move.w #8,d1
  278.  sub.w BulletSpd,d1
  279.  asr.w d1,d0
  280.  move.w d0,bulyspd
  281.  tst.w B_VisibleOrInstant+2(a5)
  282.  beq PLR1FIREBULLET
  283.  
  284.  move.w #0,bulyspd
  285.  
  286.  move.w PLR1_xoff,oldx
  287.  move.w PLR1_zoff,oldz
  288.  move.w PLR1_sinval,d0
  289.  asr.w #7,d0
  290.  add.w oldx,d0
  291.  move.w d0,newx
  292.  move.w PLR1_cosval,d0
  293.  asr.w #7,d0
  294.  add.w oldz,d0
  295.  move.w d0,newz
  296.  move.l PLR1_yoff,d0
  297.  add.l #10*128,d0
  298.  move.l d0,oldy
  299.  
  300.  move.l d0,d1
  301.  jsr GetRand
  302.  and.w #$fff,d0
  303.  sub.w #$800,d0
  304.  ext.l d0
  305.  add.l d0,d1
  306.  
  307.  move.l d1,newy
  308.  
  309.  st exitfirst
  310.  clr.b wallbounce
  311.  move.w #0,extlen
  312.  move.b #$ff,awayfromwall
  313.  move.w #%0000010000000000,wallflags
  314.  move.l #0,StepUpVal
  315.  move.l #$1000000,StepDownVal
  316.  move.l #0,thingheight
  317.  move.l PLR1_Roompt,objroom
  318.  movem.l d0-d7/a0-a6,-(a7)
  319.  
  320. .again:
  321.  jsr MoveObject
  322.  tst.b hitwall
  323.  bne.s .nofurther
  324.  move.w newx,d0
  325.  sub.w oldx,d0
  326.  add.w d0,oldx
  327.  add.w d0,newx
  328.  move.w newz,d0
  329.  sub.w oldz,d0
  330.  add.w d0,oldz
  331.  add.w d0,newz
  332.  move.l newy,d0
  333.  sub.l oldy,d0
  334.  add.l d0,oldy
  335.  add.l d0,newy
  336.  bra .again
  337.  
  338. .nofurther:
  339.  
  340.  movem.l (a7)+,d0-d7/a0-a6
  341.  
  342.  move.l PlayerShotData,a0
  343.  move.w #19,d1
  344. .findonefree2
  345.  move.w 12(a0),d2
  346.  blt.s .foundonefree2
  347.  adda.w #64,a0
  348.  dbra d1,.findonefree2
  349.  
  350.  rts
  351.  
  352. .foundonefree2:
  353.  
  354.  move.l ObjectPoints,a1
  355.  move.w (a0),d2
  356.  move.w newx,(a1,d2.w*8)
  357.  move.w newz,4(a1,d2.w*8)
  358.  move.b #1,shotstatus(a0)
  359.  move.w #0,shotgrav(a0)
  360.  move.b BULTYPE+1,shotsize(a0)
  361.  move.b #0,shotanim(a0)
  362.  
  363.  move.l objroom,a1
  364.  move.w (a1),12(a0)
  365.  st worry(a0)
  366.  move.l wallhitheight,d0
  367.  move.l d0,accypos(a0)
  368.  asr.l #7,d0
  369.  move.w d0,4(a0)
  370.  
  371.  rts
  372.  
  373. PLR1_nofire:
  374.  
  375.  rts
  376.  
  377. TESTY: dc.l 0,0,0,0
  378.  
  379. Player2Shot:
  380.  
  381.  tst.w PLR2_TimeToShoot
  382.  beq.s okcanfire2
  383.  
  384.  move.w TempFrames,d0
  385.  sub.w d0,PLR2_TimeToShoot
  386.  bge PLR2_nofire
  387.  move.w #0,PLR2_TimeToShoot
  388.  bra PLR2_nofire
  389.  
  390. okcanfire2:
  391.  
  392.  moveq #0,d0
  393.  move.b p2_gunselected,d0
  394.  move.b d0,tempgun
  395.  
  396.  
  397.  move.l LINKFILE,a6
  398.  lea GunBulletTypes(a6),a6
  399.  lea BulletAnimData-GunBulletTypes(a6),a5
  400.  lea (a6,d0.w*8),a6
  401.  move.w G_BulletType(a6),d0 ; bullet type
  402.  move.w d0,BULTYPE
  403.  move.l #PLAYERTWOAMMO,a0
  404.  move.w (a0,d0.w*2),AmmoInMyGun
  405.  
  406.  muls #B_BulStatLen,d0
  407.  add.w d0,a5
  408.  
  409.  move.w B_MovementSpeed+2(a5),BulletSpd
  410.  
  411. ; tst.w 12(a6)
  412. ; beq.s .itsaclick
  413.  
  414.  tst.b p2_fire
  415.  beq PLR2_nofire
  416. ; bra .itsahold
  417. ;
  418. ;.itsaclick:
  419. ; tst.b p2_clicked
  420. ; beq PLR2_nofire
  421. ;
  422. ;.itsahold:
  423.  
  424.  move.w PLR2_angpos,d0
  425.  move.w d0,tempangpos
  426.  move.l #SineTable,a0
  427.  lea (a0,d0.w),a0
  428.  move.w (a0),tempxdir 
  429.  move.w 2048(a0),tempzdir
  430.  move.w PLR2_xoff,tempxoff
  431.  move.w PLR2_zoff,tempzoff
  432.  move.l PLR2_yoff,tempyoff
  433.  add.l #10*128,tempyoff
  434.  move.b PLR2_StoodInTop,tempStoodInTop
  435.  move.l PLR2_Roompt,tempRoompt
  436.  move.l #%10011,d7
  437.  move.w #-1,d0
  438.  move.l #0,targetydiff
  439.  move.l #$7fff,d1
  440.  
  441.  move.l ZoneAdds,a3
  442.  
  443.  move.l #PLR2_ObsInLine,a1
  444.  move.l ObjectData,a0
  445.  move.l #PLR2_ObjDists,a2
  446. findclosestinline2
  447.  
  448.  tst.w (a0)
  449.  blt outofline2
  450.  
  451.  cmp.b #3,16(a0)
  452.  beq notlinedup2
  453.  
  454.  tst.b (a1)+
  455.  beq.s notlinedup2
  456.  btst #1,17(a0)
  457.  beq.s notlinedup2
  458.  tst.w 12(a0)
  459.  blt.s notlinedup2
  460.  move.b 16(a0),d6
  461.  btst d6,d7
  462.  beq.s notlinedup2
  463.  
  464.  tst.b numlives(a0)
  465.  beq.s notlinedup2
  466.  move.w (a0),d5
  467.  move.w (a2,d5.w*2),d6
  468.  move.w 4(a0),d2
  469.  ext.l d2
  470.  asl.l #7,d2
  471.  sub.l PLR2_yoff,d2
  472.  move.l d2,d3
  473.  bge.s .oknotneg
  474.  neg.l d2
  475. .oknotneg:
  476.  divs #44,d2
  477.  cmp.w d6,d2
  478.  bgt.s notlinedup2
  479.  
  480.  cmp.w d6,d1
  481.  blt.s notlinedup2
  482.  move.w d6,d1
  483.  move.l a0,a4
  484.  
  485. ; We have a closer enemy lined up.
  486.  move.l d3,targetydiff 
  487.  move.w d5,d0
  488.  
  489. notlinedup2:
  490.  add.w #64,a0
  491.  bra findclosestinline2
  492.  
  493. outofline2:
  494.  
  495.  
  496.  move.w d1,targdist
  497.  
  498.  move.l targetydiff,d5
  499.  sub.l PLR2_height,d5
  500.  add.l #18*256,d5
  501.  move.w d1,closedist
  502.  
  503.  move.w BulletSpd,d2
  504.  asr.w d2,d1
  505.  tst.w d1
  506.  bgt.s okdistthing2
  507.  moveq #1,d1
  508. okdistthing2
  509.  divs d1,d5
  510.  move.w d5,bulyspd
  511.  
  512.  move.w AmmoInMyGun,d2
  513.  move.w G_BulletsPerShot(a6),d1
  514.  cmp.w d1,d2
  515.  bge.s .okcanshoot
  516.  
  517.  move.l PLR2_Obj,a2
  518.  move.w (a2),d0
  519.  move.l #ObjRotated,a2
  520.  move.l (a2,d0.w*8),Noisex
  521.  move.w #300,Noisevol
  522.  move.w #100,PLAYERTWONOISEVOL
  523.  move.w #12,Samplenum
  524.  clr.b notifplaying
  525.  move.b #$fb,IDNUM
  526.  jsr MakeSomeNoise
  527.  
  528.  rts
  529.  
  530. .okcanshoot:
  531.  
  532.  cmp.b #'s',mors
  533.  bne.s .notplr2
  534.  move.l PLR1_Obj,a2
  535.  move.w #1,ObjTimer+128(a2)
  536. .notplr2:
  537.  
  538.  move.w G_DelayBetweenShots(a6),PLR2_TimeToShoot
  539.  
  540.  move.b MaxFrame,PLR2_GunFrame
  541.  sub.w d1,d2
  542.  
  543.  move.l #PLAYERTWOAMMO,a2
  544.  add.w BULTYPE,a2
  545.  add.w BULTYPE,a2
  546.  move.w d2,(a2)
  547.  
  548.  move.l PLR2_Obj,a2
  549.  move.w (a2),d2
  550.  move.l #ObjRotated,a2
  551.  move.l (a2,d2.w*8),Noisex
  552.  move.w #100,PLAYERTWONOISEVOL
  553.  move.w #300,Noisevol
  554.  move.w G_SoundEffect(a6),Samplenum
  555.  move.b #2,chanpick
  556.  clr.b notifplaying
  557.  movem.l d0/a0/d5/d6/d7/a6/a4/a5,-(a7)
  558.  move.b #$fb,IDNUM
  559.  jsr MakeSomeNoise
  560.  movem.l (a7)+,d0/a0/d5/d6/d7/a6/a4/a5
  561.  
  562.  tst.w d0
  563.  blt nothingtoshoot2
  564.  
  565.  tst.l B_Gravity(a5)
  566.  beq.s .notuseaim
  567.  move.w PLR2_AIMSPD,d2
  568.  move.w #8,d1
  569.  sub.w BulletSpd,d1
  570.  asr.w d1,d2
  571.  move.w d2,bulyspd
  572. .notuseaim
  573.  
  574.  tst.w B_VisibleOrInstant+2(a5)
  575.  beq PLR2FIREBULLET
  576.  
  577. ; instant effect: check for hitting:
  578.  
  579.  move.w G_BulletsPerShot(a6),d7
  580.  
  581. FIREBULLETS2:
  582.  
  583.  movem.l a0/a1/d7/d0/a4/a5,-(a7)
  584.  jsr GetRand
  585.  
  586.  move.l ObjectPoints,a1
  587.  move.w (a4),d1
  588.  lea (a1,d1.w*8),a1
  589.  
  590.  and.w #$7fff,d0
  591.  move.w (a1),d1
  592.  sub.w PLR2_xoff,d1
  593.  muls d1,d1
  594.  move.w 4(a1),d2
  595.  sub.w PLR2_zoff,d2
  596.  muls d2,d2
  597.  add.l d2,d1
  598.  asr.l #6,d1
  599.  ext.l d0
  600.  asl.l #1,d0
  601.  cmp.l d1,d0
  602.  bgt.s .hitplr
  603.  
  604.  movem.l (a7)+,a0/a1/d7/d0/a5/a4
  605.  move.l d0,-(a7)
  606.  bsr PLR2MISSINSTANT
  607.  move.l (a7)+,d0
  608.  
  609.  bra.s .missplr
  610. .hitplr: 
  611.  
  612.  movem.l (a7)+,a0/a1/d7/d0/a5/a4
  613.  move.l d0,-(a7)
  614.  bsr PLR2HITINSTANT
  615.  move.l (a7)+,d0
  616.  
  617. .missplr:
  618.  
  619.  subq #1,d7
  620.  bgt.s FIREBULLETS2
  621.  
  622.  rts
  623.  
  624. PLR2_AIMSPD: dc.l 0
  625.  
  626. nothingtoshoot2:
  627.  move.w PLR2_AIMSPD,d0
  628.  move.w #8,d1
  629.  sub.w BulletSpd,d1
  630.  asr.w d1,d0
  631.  move.w d0,bulyspd
  632.  tst.w B_VisibleOrInstant+2(a5)
  633.  beq PLR2FIREBULLET
  634.  
  635.  move.w #0,bulyspd
  636.  
  637.  move.w PLR2_xoff,oldx
  638.  move.w PLR2_zoff,oldz
  639.  move.w PLR2_sinval,d0
  640.  asr.w #7,d0
  641.  add.w oldx,d0
  642.  move.w d0,newx
  643.  move.w PLR2_cosval,d0
  644.  asr.w #7,d0
  645.  add.w oldz,d0
  646.  move.w d0,newz
  647.  move.l PLR2_yoff,d0
  648.  add.l #10*128,d0
  649.  move.l d0,oldy
  650.  
  651.  move.l d0,d1
  652.  jsr GetRand
  653.  and.w #$fff,d0
  654.  sub.w #$800,d0
  655.  ext.l d0
  656.  add.l d0,d1
  657.  
  658.  move.l d1,newy
  659.  
  660.  st exitfirst
  661.  clr.b wallbounce
  662.  move.w #0,extlen
  663.  move.b #$ff,awayfromwall
  664.  move.w #%0000010000000000,wallflags
  665.  move.l #0,StepUpVal
  666.  move.l #$1000000,StepDownVal
  667.  move.l #0,thingheight
  668.  move.l PLR2_Roompt,objroom
  669.  movem.l d0-d7/a0-a6,-(a7)
  670.  
  671. .again:
  672.  jsr MoveObject
  673.  tst.b hitwall
  674.  bne.s .nofurther
  675.  move.w newx,d0
  676.  sub.w oldx,d0
  677.  add.w d0,oldx
  678.  add.w d0,newx
  679.  move.w newz,d0
  680.  sub.w oldz,d0
  681.  add.w d0,oldz
  682.  add.w d0,newz
  683.  move.l newy,d0
  684.  sub.l oldy,d0
  685.  add.l d0,oldy
  686.  add.l d0,newy
  687.  bra .again
  688.  
  689. .nofurther:
  690.  
  691.  movem.l (a7)+,d0-d7/a0-a6
  692.  
  693.  move.l PlayerShotData,a0
  694.  move.w #19,d1
  695. .findonefree2
  696.  move.w 12(a0),d2
  697.  blt.s .foundonefree2
  698.  adda.w #64,a0
  699.  dbra d1,.findonefree2
  700.  
  701.  rts
  702.  
  703. .foundonefree2:
  704.  
  705.  move.l ObjectPoints,a1
  706.  move.w (a0),d2
  707.  move.w newx,(a1,d2.w*8)
  708.  move.w newz,4(a1,d2.w*8)
  709.  move.b #1,shotstatus(a0)
  710.  move.w #0,shotgrav(a0)
  711.  move.b BULTYPE+1,shotsize(a0)
  712.  move.b #0,shotanim(a0)
  713.  
  714.  move.l objroom,a1
  715.  move.w (a1),12(a0)
  716.  st worry(a0)
  717.  move.l wallhitheight,d0
  718.  move.l d0,accypos(a0)
  719.  asr.l #7,d0
  720.  move.w d0,4(a0)
  721.  
  722.  rts
  723.  
  724. PLR2_nofire:
  725.  
  726.  rts
  727.  
  728.  
  729. ***************************************
  730.  
  731.  
  732. Player3Shot:
  733.  
  734.  tst.w PLR3_TimeToShoot
  735.  beq.s okcanfire3
  736.  
  737.  move.w TempFrames,d0
  738.  sub.w d0,PLR3_TimeToShoot
  739.  bge PLR3_nofire
  740.  move.w #0,PLR3_TimeToShoot
  741.  bra PLR3_nofire
  742.  
  743. okcanfire3:
  744.  
  745.  moveq #0,d0
  746.  move.b p3_gunselected,d0
  747.  move.b d0,tempgun
  748.  
  749.  
  750.  move.l LINKFILE,a6
  751.  lea GunBulletTypes(a6),a6
  752.  lea BulletAnimData-GunBulletTypes(a6),a5
  753.  lea (a6,d0.w*8),a6
  754.  move.w G_BulletType(a6),d0 ; bullet type
  755.  move.w d0,BULTYPE
  756.  move.l #PLAYERTHREEAMMO,a0
  757.  move.w (a0,d0.w*2),AmmoInMyGun
  758.  
  759.  muls #B_BulStatLen,d0
  760.  add.w d0,a5
  761.  
  762.  move.w B_MovementSpeed+2(a5),BulletSpd
  763.  
  764. ; tst.w 12(a6)
  765. ; beq.s .itsaclick
  766.  
  767.  tst.b p3_fire
  768.  beq PLR3_nofire
  769. ; bra .itsahold
  770. ;
  771. ;.itsaclick:
  772. ; tst.b p2_clicked
  773. ; beq PLR2_nofire
  774. ;
  775. ;.itsahold:
  776.  
  777.  move.w PLR3_angpos,d0
  778.  move.w d0,tempangpos
  779.  move.l #SineTable,a0
  780.  lea (a0,d0.w),a0
  781.  move.w (a0),tempxdir 
  782.  move.w 2048(a0),tempzdir
  783.  move.w PLR3_xoff,tempxoff
  784.  move.w PLR3_zoff,tempzoff
  785.  move.l PLR3_yoff,tempyoff
  786.  add.l #10*128,tempyoff
  787.  move.b PLR3_StoodInTop,tempStoodInTop
  788.  move.l PLR3_Roompt,tempRoompt
  789.  move.l #%10011,d7
  790.  move.w #-1,d0
  791.  move.l #0,targetydiff
  792.  move.l #$7fff,d1
  793.  
  794.  move.l ZoneAdds,a3
  795.  
  796.  move.l #PLR3_ObsInLine,a1
  797.  move.l ObjectData,a0
  798.  move.l #PLR3_ObjDists,a2
  799. findclosestinline3
  800.  
  801.  tst.w (a0)
  802.  blt outofline3
  803.  
  804.  cmp.b #3,16(a0)
  805.  beq notlinedup3
  806.  
  807.  tst.b (a1)+
  808.  beq.s notlinedup3
  809.  btst #1,17(a0)
  810.  beq.s notlinedup3
  811.  tst.w 12(a0)
  812.  blt.s notlinedup3
  813.  move.b 16(a0),d6
  814.  btst d6,d7
  815.  beq.s notlinedup3
  816.  
  817.  tst.b numlives(a0)
  818.  beq.s notlinedup3
  819.  move.w (a0),d5
  820.  move.w (a2,d5.w*2),d6
  821.  move.w 4(a0),d2
  822.  ext.l d2
  823.  asl.l #7,d2
  824.  sub.l PLR3_yoff,d2
  825.  move.l d2,d3
  826.  bge.s .oknotneg
  827.  neg.l d2
  828. .oknotneg:
  829.  divs #44,d2
  830.  cmp.w d6,d2
  831.  bgt.s notlinedup3
  832.  
  833.  cmp.w d6,d1
  834.  blt.s notlinedup3
  835.  move.w d6,d1
  836.  move.l a0,a4
  837.  
  838. ; We have a closer enemy lined up.
  839.  move.l d3,targetydiff 
  840.  move.w d5,d0
  841.  
  842. notlinedup3:
  843.  add.w #64,a0
  844.  bra findclosestinline3
  845.  
  846. outofline3:
  847.  
  848.  
  849.  move.w d1,targdist
  850.  
  851.  move.l targetydiff,d5
  852.  sub.l PLR3_height,d5
  853.  add.l #18*256,d5
  854.  move.w d1,closedist
  855.  
  856.  move.w BulletSpd,d2
  857.  asr.w d2,d1
  858.  tst.w d1
  859.  bgt.s okdistthing3
  860.  moveq #1,d1
  861. okdistthing3
  862.  divs d1,d5
  863.  move.w d5,bulyspd
  864.  
  865.  move.w AmmoInMyGun,d2
  866.  move.w G_BulletsPerShot(a6),d1
  867.  cmp.w d1,d2
  868.  bge.s .okcanshoot
  869.  
  870.  move.l PLR3_Obj,a2
  871.  move.w (a2),d0
  872.  move.l #ObjRotated,a2
  873.  move.l (a2,d0.w*8),Noisex
  874.  move.w #300,Noisevol
  875.  move.w #100,PLAYERTHREENOISEVOL
  876.  move.w #12,Samplenum
  877.  clr.b notifplaying
  878.  move.b #$fb,IDNUM
  879.  jsr MakeSomeNoise
  880.  
  881.  rts
  882.  
  883. .okcanshoot:
  884.  
  885.  cmp.b #'s',mors
  886.  bne.s .notplr3
  887.  move.l PLR3_Obj,a2
  888.  move.w #1,ObjTimer+128(a2)
  889. .notplr3:
  890.  
  891.  move.w G_DelayBetweenShots(a6),PLR3_TimeToShoot
  892.  
  893.  move.b MaxFrame,PLR3_GunFrame
  894.  sub.w d1,d2
  895.  
  896.  move.l #PLAYERTHREEAMMO,a2
  897.  add.w BULTYPE,a2
  898.  add.w BULTYPE,a2
  899.  move.w d2,(a2)
  900.  
  901.  move.l PLR3_Obj,a2
  902.  move.w (a2),d2
  903.  move.l #ObjRotated,a2
  904.  move.l (a2,d2.w*8),Noisex
  905.  move.w #100,PLAYERTHREENOISEVOL
  906.  move.w #300,Noisevol
  907.  move.w G_SoundEffect(a6),Samplenum
  908.  move.b #2,chanpick
  909.  clr.b notifplaying
  910.  movem.l d0/a0/d5/d6/d7/a6/a4/a5,-(a7)
  911.  move.b #$fb,IDNUM
  912.  jsr MakeSomeNoise
  913.  movem.l (a7)+,d0/a0/d5/d6/d7/a6/a4/a5
  914.  
  915.  tst.w d0
  916.  blt nothingtoshoot3
  917.  
  918.  tst.l B_Gravity(a5)
  919.  beq.s .notuseaim
  920.  move.w PLR3_AIMSPD,d2
  921.  move.w #8,d1
  922.  sub.w BulletSpd,d1
  923.  asr.w d1,d2
  924.  move.w d2,bulyspd
  925. .notuseaim
  926.  
  927.  tst.w B_VisibleOrInstant+2(a5)
  928.  beq PLR3FIREBULLET
  929.  
  930. ; instant effect: check for hitting:
  931.  
  932.  move.w G_BulletsPerShot(a6),d7
  933.  
  934. FIREBULLETS3:
  935.  
  936.  movem.l a0/a1/d7/d0/a4/a5,-(a7)
  937.  jsr GetRand
  938.  
  939.  move.l ObjectPoints,a1
  940.  move.w (a4),d1
  941.  lea (a1,d1.w*8),a1
  942.  
  943.  and.w #$7fff,d0
  944.  move.w (a1),d1
  945.  sub.w PLR3_xoff,d1
  946.  muls d1,d1
  947.  move.w 4(a1),d2
  948.  sub.w PLR3_zoff,d2
  949.  muls d2,d2
  950.  add.l d2,d1
  951.  asr.l #6,d1
  952.  ext.l d0
  953.  asl.l #1,d0
  954.  cmp.l d1,d0
  955.  bgt.s .hitplr
  956.  
  957.  movem.l (a7)+,a0/a1/d7/d0/a5/a4
  958.  move.l d0,-(a7)
  959.  bsr PLR3MISSINSTANT
  960.  move.l (a7)+,d0
  961.  
  962.  bra.s .missplr
  963. .hitplr: 
  964.  
  965.  movem.l (a7)+,a0/a1/d7/d0/a5/a4
  966.  move.l d0,-(a7)
  967.  bsr PLR3HITINSTANT
  968.  move.l (a7)+,d0
  969.  
  970. .missplr:
  971.  
  972.  subq #1,d7
  973.  bgt.s FIREBULLETS3
  974.  
  975.  rts
  976.  
  977. nothingtoshoot3:
  978.  move.w PLR3_AIMSPD,d0
  979.  move.w #8,d1
  980.  sub.w BulletSpd,d1
  981.  asr.w d1,d0
  982.  move.w d0,bulyspd
  983.  tst.w B_VisibleOrInstant+2(a5)
  984.  beq PLR3FIREBULLET
  985.  
  986.  move.w #0,bulyspd
  987.  
  988.  move.w PLR3_xoff,oldx
  989.  move.w PLR3_zoff,oldz
  990.  move.w PLR3_sinval,d0
  991.  asr.w #7,d0
  992.  add.w oldx,d0
  993.  move.w d0,newx
  994.  move.w PLR3_cosval,d0
  995.  asr.w #7,d0
  996.  add.w oldz,d0
  997.  move.w d0,newz
  998.  move.l PLR3_yoff,d0
  999.  add.l #10*128,d0
  1000.  move.l d0,oldy
  1001.  
  1002.  move.l d0,d1
  1003.  jsr GetRand
  1004.  and.w #$fff,d0
  1005.  sub.w #$800,d0
  1006.  ext.l d0
  1007.  add.l d0,d1
  1008.  
  1009.  move.l d1,newy
  1010.  
  1011.  st exitfirst
  1012.  clr.b wallbounce
  1013.  move.w #0,extlen
  1014.  move.b #$ff,awayfromwall
  1015.  move.w #%0000010000000000,wallflags
  1016.  move.l #0,StepUpVal
  1017.  move.l #$1000000,StepDownVal
  1018.  move.l #0,thingheight
  1019.  move.l PLR3_Roompt,objroom
  1020.  movem.l d0-d7/a0-a6,-(a7)
  1021.  
  1022. .again:
  1023.  jsr MoveObject
  1024.  tst.b hitwall
  1025.  bne.s .nofurther
  1026.  move.w newx,d0
  1027.  sub.w oldx,d0
  1028.  add.w d0,oldx
  1029.  add.w d0,newx
  1030.  move.w newz,d0
  1031.  sub.w oldz,d0
  1032.  add.w d0,oldz
  1033.  add.w d0,newz
  1034.  move.l newy,d0
  1035.  sub.l oldy,d0
  1036.  add.l d0,oldy
  1037.  add.l d0,newy
  1038.  bra .again
  1039.  
  1040. .nofurther:
  1041.  
  1042.  movem.l (a7)+,d0-d7/a0-a6
  1043.  
  1044.  move.l PlayerShotData,a0
  1045.  move.w #19,d1
  1046. .findonefree2
  1047.  move.w 12(a0),d2
  1048.  blt.s .foundonefree2
  1049.  adda.w #64,a0
  1050.  dbra d1,.findonefree2
  1051.  
  1052.  rts
  1053.  
  1054. .foundonefree2:
  1055.  
  1056.  move.l ObjectPoints,a1
  1057.  move.w (a0),d2
  1058.  move.w newx,(a1,d2.w*8)
  1059.  move.w newz,4(a1,d2.w*8)
  1060.  move.b #1,shotstatus(a0)
  1061.  move.w #0,shotgrav(a0)
  1062.  move.b BULTYPE+1,shotsize(a0)
  1063.  move.b #0,shotanim(a0)
  1064.  
  1065.  move.l objroom,a1
  1066.  move.w (a1),12(a0)
  1067.  st worry(a0)
  1068.  move.l wallhitheight,d0
  1069.  move.l d0,accypos(a0)
  1070.  asr.l #7,d0
  1071.  move.w d0,4(a0)
  1072.  
  1073.  rts
  1074.  
  1075. PLR3_nofire:
  1076.  
  1077.  rts
  1078.  
  1079.  
  1080. BulletSpd: dc.w 0
  1081.  
  1082. *******************************************************
  1083.  
  1084. tempyoff: dc.l 0
  1085. tempStoodInTop: dc.w 0
  1086. tempxdir: dc.w 0
  1087. tempzdir: dc.w 0
  1088. tempgun: dc.w 0
  1089. tstfire: dc.w 0
  1090. PLR1FIREBULLET:
  1091.  
  1092.  move.l #%1100011,d7
  1093.  
  1094.  move.b MaxFrame,PLR1_GunFrame
  1095.  move.l PLR1_Obj,a2
  1096.  move.w G_BulletsPerShot(a6),d5
  1097.  
  1098.  move.w d5,d6
  1099.  subq #1,d6
  1100.  muls #128,d6
  1101.  neg.w d6
  1102.  add.w tempangpos,d6
  1103.  and.w #8190,d6
  1104.  
  1105.  bra firefive
  1106.  
  1107. PLR3FIREBULLET:
  1108.  
  1109.  move.l #%110011,d7
  1110.  
  1111.  move.b MaxFrame,PLR3_GunFrame
  1112.  move.l PLR3_Obj,a2
  1113.  move.w G_BulletsPerShot(a6),d5
  1114.  
  1115.  move.w d5,d6
  1116.  subq #1,d6
  1117.  muls #128,d6
  1118.  neg.w d6
  1119.  add.w tempangpos,d6
  1120.  and.w #8190,d6
  1121.  
  1122.  bra firefive
  1123.  
  1124.  
  1125. PLR2FIREBULLET:
  1126.  move.l #%1010011,d7
  1127.  
  1128.  move.b MaxFrame,PLR2_GunFrame
  1129.  move.l PLR2_Obj,a2
  1130.  move.w G_BulletsPerShot(a6),d5
  1131.  
  1132.  move.w d5,d6
  1133.  subq #1,d6
  1134.  muls #128,d6
  1135.  neg.w d6
  1136.  add.w tempangpos,d6
  1137.  and.w #8190,d6
  1138.  
  1139. firefive:
  1140.  
  1141.  move.l PlayerShotData,a0
  1142.  move.w #19,d1
  1143. .findonefree
  1144.  move.w 12(a0),d0
  1145.  blt.s .foundonefree
  1146.  adda.w #64,a0
  1147.  dbra d1,.findonefree
  1148.  
  1149.  rts
  1150.  
  1151. .foundonefree
  1152.  move.w B_Gravity+2(a5),shotgrav(a0)
  1153.  move.b B_BounceOffWalls+3(a5),shotflags(a0)
  1154.  move.b B_BounceOffFloors+3(a5),shotflags+1(a0)
  1155.  
  1156.  move.w bulyspd,d0
  1157.  
  1158.  cmp.w #20*128,d0
  1159.  blt.s .okdownspd
  1160.  move.w #20*128,d0
  1161. .okdownspd:
  1162.  
  1163.  cmp.w #-20*128,d0
  1164.  bgt.s .okupspd
  1165.  move.w #-20*128,d0
  1166. .okupspd:
  1167.  
  1168. ; add.w G_InitialYVel(a6),d0
  1169.  
  1170.  move.w d0,bulyspd
  1171.  
  1172.  move.l #ObjRotated,a2
  1173.  move.b BULTYPE+1,shotsize(a0)
  1174.  move.b B_DamageToTarget+3(a5),shotpower(a0)
  1175.  
  1176.  move.l ObjectPoints,a1
  1177.  move.w (a0),d1
  1178.  lea (a1,d1.w*8),a1
  1179.  move.w tempxoff,(a1)
  1180.  move.w tempzoff,4(a1)
  1181.  
  1182.  move.l #SineTable,a1
  1183.  move.w (a1,d6.w),d0
  1184.  ext.l d0
  1185.  add.w #2048,a1
  1186.  move.w (a1,d6.w),d2
  1187.  ext.l d2
  1188.  
  1189.  add.w #256,d6
  1190.  and.w #8190,d6
  1191.  
  1192.  move.w BulletSpd,d1
  1193.  asl.l d1,d0
  1194.  move.l d0,shotxvel(a0)
  1195.  ext.l d2
  1196.  asl.l d1,d2
  1197.  move.b #2,16(a0)
  1198.  move.l d2,shotzvel(a0)
  1199.  move.w bulyspd,shotyvel(a0)
  1200.  move.b tempStoodInTop,ObjInTop(a0)
  1201.  move.w #0,shotlife(a0)
  1202.  move.l d7,EnemyFlags(a0)
  1203.  move.l tempRoompt,a2
  1204.  move.w (a2),12(a0)
  1205.  move.l tempyoff,d0
  1206.  add.l #20*128,d0
  1207.  move.l d0,accypos(a0)
  1208.  st worry(a0)
  1209.  asr.l #7,d0
  1210.  move.w d0,4(a0)
  1211.  
  1212.  sub.w #1,d5
  1213.  bgt firefive
  1214.  
  1215.  rts
  1216.  
  1217. PLR1HITINSTANT:
  1218.  
  1219. ; Just blow it up.
  1220.  
  1221.  move.l PlayerShotData,a0
  1222.  move.w #19,d1
  1223. .findonefree
  1224.  move.w 12(a0),d2
  1225.  blt.s .foundonefree
  1226.  adda.w #64,a0
  1227.  dbra d1,.findonefree
  1228.  
  1229.  rts
  1230.  
  1231. .foundonefree:
  1232.  
  1233.  move.b #2,16(a0)
  1234.  move.l ObjectPoints,a1
  1235.  move.w (a0),d2
  1236.  move.l (a1,d0.w*8),(a1,d2.w*8)
  1237.  move.l 4(a1,d0.w*8),4(a1,d2.w*8)
  1238.  move.b #1,shotstatus(a0)
  1239.  move.w #0,shotgrav(a0)
  1240.  move.b BULTYPE+1,shotsize(a0)
  1241.  move.b #0,shotanim(a0)
  1242.  
  1243.  move.w 4(a4),d1
  1244.  ext.l d1
  1245.  asl.l #7,d1
  1246.  move.l d1,accypos(a0)
  1247.  move.w 12(a4),12(a0)
  1248.  st worry(a0)
  1249.  move.w 4(a4),4(a0)
  1250.  
  1251.  move.w B_DamageToTarget+2(a5),d0
  1252.  add.b d0,damagetaken(a4)
  1253.  
  1254.  move.w tempxdir,d1
  1255.  ext.l d1
  1256.  asl.l #3,d1
  1257.  swap d1
  1258.  move.w d1,ImpactX(a4)
  1259.  move.w tempzdir,d1
  1260.  ext.l d1
  1261.  asl.l #3,d1
  1262.  swap d1
  1263.  move.w d1,ImpactZ(a4)
  1264.  
  1265.  rts
  1266.  
  1267. PLR1MISSINSTANT: 
  1268.  
  1269.  move.w PLR1_xoff,oldx
  1270.  move.w PLR1_zoff,oldz
  1271.  move.l PLR1_yoff,d1
  1272.  add.l #10*128,d1
  1273.  move.l d1,oldy
  1274.  
  1275.  move.w (a4),d0
  1276.  move.l ObjectPoints,a1
  1277.  move.w (a1,d0.w*8),d2
  1278.  sub.w oldx,d2
  1279.  asr.w #1,d2
  1280.  add.w oldx,d2
  1281.  move.w d2,newx
  1282.  move.w 4(a1,d0.w*8),d2
  1283.  sub.w oldz,d2
  1284.  asr.w #1,d2
  1285.  add.w oldz,d2
  1286.  move.w d2,newz
  1287.  
  1288.  move.w 4(a0),d2
  1289.  ext.l d2
  1290.  asl.l #7,d2
  1291.  move.l d2,newy
  1292.  
  1293.  st exitfirst
  1294.  clr.b wallbounce
  1295.  move.w #0,extlen
  1296.  move.b #$ff,awayfromwall
  1297.  move.w #%0000010000000000,wallflags
  1298.  move.l #0,StepUpVal
  1299.  move.l #$1000000,StepDownVal
  1300.  move.l #0,thingheight
  1301.  move.l PLR1_Roompt,objroom
  1302.  movem.l d0-d7/a0-a6,-(a7)
  1303.  
  1304. .again:
  1305.  jsr MoveObject
  1306.  tst.b hitwall
  1307.  bne.s .nofurther
  1308.  move.w newx,d1
  1309.  sub.w oldx,d1
  1310.  add.w d1,oldx
  1311.  add.w d1,newx
  1312.  move.w newz,d1
  1313.  sub.w oldz,d1
  1314.  add.w d1,oldz
  1315.  add.w d1,newz
  1316.  move.l newy,d1
  1317.  sub.l oldy,d1
  1318.  add.l d1,oldy
  1319.  add.l d1,newy
  1320.  bra .again
  1321.  
  1322. .nofurther:
  1323.  
  1324.  movem.l (a7)+,d0-d7/a0-a6
  1325.  
  1326.  move.l PlayerShotData,a0
  1327.  move.w #19,d1
  1328. .findonefree2
  1329.  move.w 12(a0),d2
  1330.  blt.s .foundonefree2
  1331.  adda.w #64,a0
  1332.  dbra d1,.findonefree2
  1333.  
  1334.  rts
  1335.  
  1336. .foundonefree2:
  1337.  
  1338.  move.b #2,16(a0)
  1339.  move.l ObjectPoints,a1
  1340.  move.w (a0),d2
  1341.  move.w newx,(a1,d2.w*8)
  1342.  move.w newz,4(a1,d2.w*8)
  1343.  move.b #1,shotstatus(a0)
  1344.  move.w #0,shotgrav(a0)
  1345.  move.b BULTYPE+1,shotsize(a0)
  1346.  move.b #0,shotanim(a0)
  1347.  
  1348.  move.l objroom,a1
  1349.  move.w (a1),12(a0)
  1350.  st worry(a0)
  1351.  move.l newy,d1
  1352.  move.l d1,accypos(a0)
  1353.  asr.l #7,d1
  1354.  move.w d1,4(a0)
  1355.  
  1356.  rts
  1357.  
  1358.  
  1359. PLR2HITINSTANT:
  1360.  
  1361. ; Just blow it up.
  1362.  
  1363.  move.l PlayerShotData,a0
  1364.  move.w #19,d1
  1365. .findonefree
  1366.  move.w 12(a0),d2
  1367.  blt.s .foundonefree
  1368.  adda.w #64,a0
  1369.  dbra d1,.findonefree
  1370.  
  1371.  rts
  1372.  
  1373. .foundonefree:
  1374.  
  1375.  move.b #2,16(a0)
  1376.  move.l ObjectPoints,a1
  1377.  move.w (a0),d2
  1378.  move.l (a1,d0.w*8),(a1,d2.w*8)
  1379.  move.l 4(a1,d0.w*8),4(a1,d2.w*8)
  1380.  move.b #1,shotstatus(a0)
  1381.  move.w #0,shotgrav(a0)
  1382.  move.b BULTYPE+1,shotsize(a0)
  1383.  move.b #0,shotanim(a0)
  1384.  
  1385.  move.w 4(a4),d1
  1386.  ext.l d1
  1387.  asl.l #7,d1
  1388.  move.l d1,accypos(a0)
  1389.  move.w 12(a4),12(a0)
  1390.  st worry(a0)
  1391.  move.w 4(a4),4(a0)
  1392.  
  1393.  move.w B_DamageToTarget+2(a5),d0
  1394.  add.b d0,damagetaken(a4)
  1395.  
  1396.  move.w tempxdir,d1
  1397.  ext.l d1
  1398.  asl.l #3,d1
  1399.  swap d1
  1400.  move.w d1,ImpactX(a4)
  1401.  move.w tempzdir,d1
  1402.  ext.l d1
  1403.  asl.l #3,d1
  1404.  swap d1
  1405.  move.w d1,ImpactZ(a4)
  1406.  
  1407.  rts
  1408.  
  1409. PLR2MISSINSTANT: 
  1410.  
  1411.  move.w PLR2_xoff,oldx
  1412.  move.w PLR2_zoff,oldz
  1413.  move.l PLR2_yoff,d1
  1414.  add.l #10*128,d1
  1415.  move.l d1,oldy
  1416.  
  1417.  move.w (a4),d0
  1418.  move.l ObjectPoints,a1
  1419.  move.w (a1,d0.w*8),d2
  1420.  sub.w oldx,d2
  1421.  asr.w #1,d2
  1422.  add.w oldx,d2
  1423.  move.w d2,newx
  1424.  move.w 4(a1,d0.w*8),d2
  1425.  sub.w oldz,d2
  1426.  asr.w #1,d2
  1427.  add.w oldz,d2
  1428.  move.w d2,newz
  1429.  
  1430.  move.w 4(a0),d2
  1431.  ext.l d2
  1432.  asl.l #7,d2
  1433.  move.l d2,newy
  1434.  
  1435.  st exitfirst
  1436.  clr.b wallbounce
  1437.  move.w #0,extlen
  1438.  move.b #$ff,awayfromwall
  1439.  move.w #%0000010000000000,wallflags
  1440.  move.l #0,StepUpVal
  1441.  move.l #$1000000,StepDownVal
  1442.  move.l #0,thingheight
  1443.  move.l PLR2_Roompt,objroom
  1444.  movem.l d0-d7/a0-a6,-(a7)
  1445.  
  1446. .again:
  1447.  jsr MoveObject
  1448.  tst.b hitwall
  1449.  bne.s .nofurther
  1450.  move.w newx,d1
  1451.  sub.w oldx,d1
  1452.  add.w d1,oldx
  1453.  add.w d1,newx
  1454.  move.w newz,d1
  1455.  sub.w oldz,d1
  1456.  add.w d1,oldz
  1457.  add.w d1,newz
  1458.  move.l newy,d1
  1459.  sub.l oldy,d1
  1460.  add.l d1,oldy
  1461.  add.l d1,newy
  1462.  bra .again
  1463.  
  1464. .nofurther:
  1465.  
  1466.  movem.l (a7)+,d0-d7/a0-a6
  1467.  
  1468.  move.l PlayerShotData,a0
  1469.  move.w #19,d1
  1470. .findonefree2
  1471.  move.w 12(a0),d2
  1472.  blt.s .foundonefree2
  1473.  adda.w #64,a0
  1474.  dbra d1,.findonefree2
  1475.  
  1476.  rts
  1477.  
  1478. .foundonefree2:
  1479.  
  1480.  move.b #2,16(a0)
  1481.  move.l ObjectPoints,a1
  1482.  move.w (a0),d2
  1483.  move.w newx,(a1,d2.w*8)
  1484.  move.w newz,4(a1,d2.w*8)
  1485.  move.b #1,shotstatus(a0)
  1486.  move.w #0,shotgrav(a0)
  1487.  move.b BULTYPE+1,shotsize(a0)
  1488.  move.b #0,shotanim(a0)
  1489.  
  1490.  move.l objroom,a1
  1491.  move.w (a1),12(a0)
  1492.  st worry(a0)
  1493.  move.l newy,d1
  1494.  move.l d1,accypos(a0)
  1495.  asr.l #7,d1
  1496.  move.w d1,4(a0)
  1497.  
  1498.  rts
  1499.  
  1500.  
  1501.  
  1502. PLR3HITINSTANT:
  1503.  
  1504. ; Just blow it up.
  1505.  
  1506.  move.l PlayerShotData,a0
  1507.  move.w #19,d1
  1508. .findonefree
  1509.  move.w 12(a0),d2
  1510.  blt.s .foundonefree
  1511.  adda.w #64,a0
  1512.  dbra d1,.findonefree
  1513.  
  1514.  rts
  1515.  
  1516. .foundonefree:
  1517.  
  1518.  move.b #2,16(a0)
  1519.  move.l ObjectPoints,a1
  1520.  move.w (a0),d2
  1521.  move.l (a1,d0.w*8),(a1,d2.w*8)
  1522.  move.l 4(a1,d0.w*8),4(a1,d2.w*8)
  1523.  move.b #1,shotstatus(a0)
  1524.  move.w #0,shotgrav(a0)
  1525.  move.b BULTYPE+1,shotsize(a0)
  1526.  move.b #0,shotanim(a0)
  1527.  
  1528.  move.w 4(a4),d1
  1529.  ext.l d1
  1530.  asl.l #7,d1
  1531.  move.l d1,accypos(a0)
  1532.  move.w 12(a4),12(a0)
  1533.  st worry(a0)
  1534.  move.w 4(a4),4(a0)
  1535.  
  1536.  move.w B_DamageToTarget+2(a5),d0
  1537.  add.b d0,damagetaken(a4)
  1538.  
  1539.  move.w tempxdir,d1
  1540.  ext.l d1
  1541.  asl.l #3,d1
  1542.  swap d1
  1543.  move.w d1,ImpactX(a4)
  1544.  move.w tempzdir,d1
  1545.  ext.l d1
  1546.  asl.l #3,d1
  1547.  swap d1
  1548.  move.w d1,ImpactZ(a4)
  1549.  
  1550.  rts
  1551.  
  1552. PLR3MISSINSTANT: 
  1553.  
  1554.  move.w PLR3_xoff,oldx
  1555.  move.w PLR3_zoff,oldz
  1556.  move.l PLR3_yoff,d1
  1557.  add.l #10*128,d1
  1558.  move.l d1,oldy
  1559.  
  1560.  move.w (a4),d0
  1561.  move.l ObjectPoints,a1
  1562.  move.w (a1,d0.w*8),d2
  1563.  sub.w oldx,d2
  1564.  asr.w #1,d2
  1565.  add.w oldx,d2
  1566.  move.w d2,newx
  1567.  move.w 4(a1,d0.w*8),d2
  1568.  sub.w oldz,d2
  1569.  asr.w #1,d2
  1570.  add.w oldz,d2
  1571.  move.w d2,newz
  1572.  
  1573.  move.w 4(a0),d2
  1574.  ext.l d2
  1575.  asl.l #7,d2
  1576.  move.l d2,newy
  1577.  
  1578.  st exitfirst
  1579.  clr.b wallbounce
  1580.  move.w #0,extlen
  1581.  move.b #$ff,awayfromwall
  1582.  move.w #%0000010000000000,wallflags
  1583.  move.l #0,StepUpVal
  1584.  move.l #$1000000,StepDownVal
  1585.  move.l #0,thingheight
  1586.  move.l PLR3_Roompt,objroom
  1587.  movem.l d0-d7/a0-a6,-(a7)
  1588.  
  1589. .again:
  1590.  jsr MoveObject
  1591.  tst.b hitwall
  1592.  bne.s .nofurther
  1593.  move.w newx,d1
  1594.  sub.w oldx,d1
  1595.  add.w d1,oldx
  1596.  add.w d1,newx
  1597.  move.w newz,d1
  1598.  sub.w oldz,d1
  1599.  add.w d1,oldz
  1600.  add.w d1,newz
  1601.  move.l newy,d1
  1602.  sub.l oldy,d1
  1603.  add.l d1,oldy
  1604.  add.l d1,newy
  1605.  bra .again
  1606.  
  1607. .nofurther:
  1608.  
  1609.  movem.l (a7)+,d0-d7/a0-a6
  1610.  
  1611.  move.l PlayerShotData,a0
  1612.  move.w #19,d1
  1613. .findonefree2
  1614.  move.w 12(a0),d2
  1615.  blt.s .foundonefree2
  1616.  adda.w #64,a0
  1617.  dbra d1,.findonefree2
  1618.  
  1619.  rts
  1620.  
  1621. .foundonefree2:
  1622.  
  1623.  move.b #2,16(a0)
  1624.  move.l ObjectPoints,a1
  1625.  move.w (a0),d2
  1626.  move.w newx,(a1,d2.w*8)
  1627.  move.w newz,4(a1,d2.w*8)
  1628.  move.b #1,shotstatus(a0)
  1629.  move.w #0,shotgrav(a0)
  1630.  move.b BULTYPE+1,shotsize(a0)
  1631.  move.b #0,shotanim(a0)
  1632.  
  1633.  move.l objroom,a1
  1634.  move.w (a1),12(a0)
  1635.  st worry(a0)
  1636.  move.l newy,d1
  1637.  move.l d1,accypos(a0)
  1638.  asr.l #7,d1
  1639.  move.w d1,4(a0)
  1640.  
  1641.  rts
  1642.